﻿Public Class frmTestPromotionEngine

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'DataSet1.oDocLine' table. You can move, or remove it, as needed.
        Me.ODocLineTableAdapter.Fill(Me.DataSet1.oDocLine)
        'TODO: This line of code loads data into the 'DataSet1.oDocHeader' table. You can move, or remove it, as needed.
        Me.ODocHeaderTableAdapter.Fill(Me.DataSet1.oDocHeader)
        Dim pro As New PromotionEngine.PromotionEngine
        pro.CallPromotion("")
    End Sub

    Private Sub ODocHeaderBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ODocHeaderBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.ODocHeaderBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.DataSet1)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim xmlstring As String
        Dim opro As New PromotionEngine.PromotionEngine
        Dim dsData As New DataSet
        Dim dsresult As New DataSet
        xmlstring = opro.ConvertDataset2XMLString("Pro", dsData, False)

        dsresult = opro.CallPromotion(xmlstring)

    End Sub
End Class
